#include<bits/stdc++.h>
using namespace std;
int main(){
	int a[11];
	string s;
	cin >> s;
	for(int i = 0, j = 0; i < 13;i++){
		if(i == 1 || i == 5 || i == 11)
			continue;
		a[j++] = s[i] - '0';
	}
	int sum = 0;
	for(int i = 0; i < 9; i++){
		sum += (a[i] * (i+1));
	}
	sum %= 11;
	if(sum == 10 && a[9] == 'X' - '0'){
		cout << "Right" << endl;
		return 0;
	}else if(sum == 10 && a[9] != 'X' - '0'){
		s[12] = 'X';
		cout << s;
		return 0;
	}
	if(sum == a[9]){
		cout << "Right" << endl;
	}else{
		s[12] = sum + '0';
		cout << s << endl;
	}
	return 0;
} 
